const express = require('express');
//创建服务器
const app =express();
app.use((req,res,next)=>{
	console.log('请求走了app.use中间件');
	next();
})
app.use('/request',(req,res,next)=>{
	console.log('请求走了request');
	next();
})

app.get('/request',(req,res,next)=>{
  req.name="张三";
  next();
})
app.get('/request',(req,res)=>{
  res.send(req.name)
})
//监听端口
app.listen(3000);
console.log('服务器启动成功')